<template>
  <div>
    <keep-alive>
    <CustomerData v-if="!showInfoPage" @customerInfo="customerInfo" />
    </keep-alive>
    <CustomerInfo
      :pageType="pageType"
      :searchData="searchData"
      :rowData="rowData"
      @customerCallBack="customerCallBack"
      v-if="showInfoPage"
    />
  </div>
</template>

<script>
import CustomerData from "./customerData.vue";
import CustomerInfo from "./customerInfo.vue";
export default {
  components: {
    CustomerData,
    CustomerInfo,
  },
  data() {
    return {
      showInfoPage: false,
      pageType: null,
      searchData: null,
      rowData: null,
    };
  },
  methods: {
    // 详情接口
    customerInfo(row, type, searchData) {
      this.pageType = type;
      this.searchData = searchData;
      this.rowData = row;
      this.showInfoPage = true;
    },
    //返回列表
    customerCallBack() {
      this.showInfoPage = false;
    },
  },
};
</script>

<style lang="less" scoped>
</style>